package com.wx.service.comfig.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.wx.dao.comfig.TradeDAO;
import com.wx.service.comfig.ComfigService;
import com.wx.vo.comfig.Trade;
@Service("comfigService")
public class ComfigServiceImpl implements ComfigService {

	@Autowired
	@Qualifier("tradeDAO")
	private TradeDAO tradeDao ;
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	public void test(String str) {
		
		Trade t = new Trade();
		t.setCreatetime(new Date());
		t.setStatus(1L);
		t.setName("12345");
		t.setCreateby("23456");
		t.setUpdateby("345");
		t.setUpdatetime(new Date());
		
		tradeDao.save(t);
		List list = tradeDao.findAll();
		System.out.println(list.size());
	//	Integer.valueOf("dfdfdfd");
	}
	
//	private void test1( TradeDAO tradeDao ){
//		Trade t = new Trade();
//		t.setCreatetime(new Date());
//		t.setStatus(1L);
//		t.setName("1111");
//		t.setCreateby("111111");
//		t.setUpdateby("11111");
//		t.setUpdatetime(new Date());
//		
//		tradeDao.save( t );
//	}

}
